package com.un.ebs.inventory.mapper;

import com.un.ebs.inventory.domain.Warehouse;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

/**
 * <p>
 * 仓库 Mapper 接口
 * </p>
 *
 * @author liubo
 * @since 2020-05-24
 */
@Component
public interface WarehouseMapper extends BaseMapper<Warehouse> {
    @Select("select isnull(max(sort)+1,1) from tb_warehouse where parent_id=#{parentId}")
    int maxSortByParentId(@Param("parentId") String parentId);

}
